﻿@* 
Project: Aguafrommars/TheIdServer
Copyright (c) 2022 @Olivier Lefebvre
*@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@namespace Aguacongas.TheIdServer.Areas.Identity.Pages.Account.Manage
@inject IViewLocalizer Localizer
@model CibaModel
@{
    ViewData["Title"] = Localizer["Pending Backchannel Login Requests"];
    ViewData["ActivePage"] = ManageNavPages.Ciba;
}

<h4>@ViewData["Title"]</h4>
<h5>@Localizer["Below is the list of backchannel login requests awaiting your approbation."]</h5>
@if (Model.Logins.Any() == true)
{
    <table class="table table-bordered table-striped table-sm">
        <caption class="visually-hidden">@Localizer["Pending Backchannel Login Requests"]</caption>
        <thead>
            <tr>
                <th scope="col">@Localizer["Id"]</th>
                <th scope="col">@Localizer["Client Id"]</th>
                <th scope="col">@Localizer["Binding Message"]</th>
                <th scope="col"></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var login in Model.Logins)
            {
                <tr class="align-middle">
                    <td>@login.InternalId</td>
                    <td>@login.Client.ClientId</td>
                    <td>@login.BindingMessage</td>
                    <td>
                        <a asp-controller="Ciba" asp-action="Consent" asp-route-id="@login.InternalId" class="btn btn-primary">@Localizer["Process"]</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <div>@Localizer["No Pending Login Requests"]</div>
}
